package com.linkwedo.saas.project;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.interceptor.ServletRequestAware;

//import com.db.TbTask;
//import com.db.TbTaskDAO;
import com.linkwedo.saas.domain.Task;
import com.opensymphony.xwork2.ActionSupport;

public class LoadTaskAction extends ActionSupport implements ServletRequestAware{
	private static final long serialVersionUID = 8190003683775267839L;
	private javax.servlet.http.HttpServletRequest request;
	private TaskService taskService;
	public TaskService getTaskService() {
		return taskService;
	}

	public void setTaskService(TaskService taskService) {
		this.taskService = taskService;
	}

	public void setServletRequest(HttpServletRequest request) {
		// TODO Auto-generated method stub
		this.request=request;
	}
	List list;
	public List getList() {
		return list;
	}

	public void setList(List list) {
		this.list = list;
	}


	public String execute() throws Exception {
		Integer pid=new Integer(request.getParameter("pid"));
		System.out.println(pid);
		try{
		list=taskService.findByProjectID(pid);
	 	for(Task pro:(List<Task>)list){
	 	 	System.out.println(pro.getName());
		}}catch(Exception e){
			e.printStackTrace();
		}
		System.out.println("list size"+list.size());
			return "SUCCESS";
	}
	
	}
